ttBulkCpユーティリティは、TimesTen表とASCIIファイルの間でデータをコピーします。レッスン3で作成した表に移入するデータを含むファイルは、install_dir/demo/quickstart
ディレクトリに存在します。ファイル名は、customer.dat
、orders.dat
およびref_products.dat
です。簡単に識別できるように、データファイルの基本名は表の名前と同じにしてあります。
Customer表にデータを移入するには、次の手順に従います。
コマンド・プロンプトで次の文を実行します。
ttBulkCp -i -d warn DSN=ref_customers owner.customer customer.dat
注意: | .dat ファイルのパスまたはディレクトリを指定する必要があります。ファイルのフルパスに空白が含まれる場合、パスおよびファイル名を二重引用符で囲む必要があります。レッスン3のように、ttIsqlからdescribe コマンドを実行すると、所有者名が表示されます。指定する引数の詳細は、『Oracle TimesTen In-Memory Database APIリファレンス・ガイド』を参照してください。 |
次のメッセージが表示されます。
customer.dat:
25 rows inserted
25 rows total
Customer表にロードされたデータを表示するには、次の手順を実行します。
SELECTの結果は次のとおりです。
< 3700, Peter , Burchard , 882 Osborne Avenue, Boston, MA 02122 >
< 1121, Saul , Mendoza , 721 Stardust Street, Mountain View, CA 94043 >
< 1278, Mary , Behr , 2233 Emerson Road, Vancouver, WA 98663 >
< 1868, Paul , Tu , 308 Bowman Court, Palo Alto, CA 94309 >
< 3645, John , Silva , 3329 Taffy Lane, Atlanta, GA 30314 >
< 1935, Sandra , Lao , 115 Spangler Avenue, San Jose, CA 95112 >
< 1002, Marco , Mueller , 40 East 5th Avenue, New York, NY 10009 >
< 2364, Karen , Johnson , 3971 Hill Road, Chicago, IL 60608 >
< 2655, Linda , Garcia , 7599 Clark Road, Denver, CO 80210 >
< 1077, Gautam , Mudunuri , 16 Welsley Avenue, Fremont, CA 94555 >
< 3864, Ruth , Silver , 88 West 65th Street, New York, NY 10009 >
< 1010, Fatima , Borba , 6868 Bascom Avenue, San Jose, CA 95128 >
< 2300, Pavel , Popov , 233 Loredo Street, Dallas, TX 75210 >
< 1001, Steven , McPhee , 72 Vine Street, San Jose, CA 95125 >
< 3525, Anthony , Bianchi , 122 Fuller Avenue, Patchogue, NY 11772 >
< 2826, Mary , Anderson , 6363 Bjorn Road, Minneapolis, MN 55417 >
< 2435, Juanita , Dawes , 733 Valdosta Avenue, Baton Rouge, LA 70816 >
< 1224, Abdul , Aziz , 6793 Bird Avenue, San Jose, CA 95126 >
< 3611, Katherine , McKenzie , 54 East 21st Avenue, New York, NY 10009 >
< 1900, Patricia , Levesque , 658 Aristotle Road, Palo Alto, CA 94305 >
< 3290, Paula , Rossi , 21 West 54th Street, New York, NY 10009 >
< 1665, David , Singh , 4001 West Hedding, San Jose, CA 95216 >
< 3098, Cynthia , Stewart , 333 East Palm Street, Miami, FL 33150 >
< 1133, Kerri , Haas , 68 East San Fernando, San Jose, CA 95113 >
< 2555, Bo , Smith , 124 North 1st Street, Dallas, TX 75210 >
25 rows found.
前述の構文と同様の構文で、ttBulkCpユーティリティを使用して、demoディレクトリの.dat
ファイルからref_productsおよびOrders表にデータを移入します。
Orders表に対して、前述の表の場合と同様にSELECT文を実行します。SELECTの結果は次のとおりです。
Command> select * from orders;
< 6853036, 3700, 0028616731, 1996-04-05 >
< 6853041, 3700, 0198612710, 1997-01-12 >
< 6853169, 1121, 0003750299, 1997-08-01 >
< 6853174, 1121, 0789428741, 1998-02-02 >
< 6853179, 1121, 0198612583, 1998-10-25 >
< 6853302, 1278, 0198612605, 1998-08-22 >
< 6853435, 1868, 0198613202, 1999-04-15 >
< 6853568, 3645, 0028616731, 1998-06-28 >
< 6853701, 1935, 0395671612, 1998-02-12 >
< 6853834, 1002, 0395448956, 1998-05-07 >
< 6853967, 2364, 0877797099, 1997-08-30 >
< 6853967, 2364, 0789435578, 1997-08-30 >
< 6853967, 2364, 0877799113, 1997-08-30 >
< 6854100, 2655, 0440218616, 1996-07-22 >
< 6854105, 2655, 0877797099, 1997-08-30 >
< 6854233, 1077, 0789435578, 1997-12-01 >
< 6854366, 3864, 0877799113, 1998-09-20 >
< 6854499, 1010, 0028616731, 1998-06-06 >
< 6854632, 2300, 0877799113, 1999-10-15 >
< 6854765, 1001, 0198612605, 1999-11-25 >
< 6854765, 1001, 0789435578, 1999-11-25 >
< 6854765, 1001, 0877799113, 1999-11-25 >
< 6854770, 1001, 0198612710, 1999-12-07 >
< 6854898, 3525, 0877799113, 1998-08-08 >
< 6855031, 2826, 0028616731, 1996-03-01 >
< 6855036, 2826, 0877799113, 1996-03-08 >
< 6855164, 2435, 0385312547, 1997-02-05 >
< 6855297, 1224, 0877799113, 1996-01-03 >
< 6855297, 1224, 0877797099, 1996-01-03 >
< 6855297, 1224, 0789435578, 1996-01-03 >
< 6855297, 1224, 0198612605, 1996-01-03 >
< 6855430, 3611, 0877797099, 1997-06-24 >
< 6855435, 3611, 0877799113, 1997-12-05 >
< 6855440, 3611, 0198612710, 1998-03-13 >
< 6855445, 3611, 0198612583, 1998-11-11 >
< 6855563, 1900, 0194314219, 1998-05-07 >
< 6855696, 3290, 0385312547, 1998-08-22 >
< 6855701, 3290, 0028616731, 1999-03-01 >
< 6855829, 1665, 0440218616, 1998-08-30 >
< 6855962, 3098, 0877799113, 1997-04-07 >
< 6855967, 3098, 0789435578, 1998-04-14 >
< 6856095, 1133, 0877799113, 1996-05-02 >
< 6856228, 2555, 0194314219, 1999-06-17 >
43 rows found.
ref_products表に対して、前述の表の場合と同様にSELECT文を実行します。SELECTの結果は次のとおりです。
Command> select * from ref_products;
< 0194314219, Oxford Advanced Learner's Dictionary of Current English, 26.95 >
< 0877799113, The Merriam Webster Dictionary, 5.99 >
< 0789435578, Dk Illustrated Oxford Dictionary, 50.00 >
< 0877797099, Merriam Webster's Collegiate Dictionary (10th Edition), 24.95 >
< 0395671612, The American Heritage College Dictionary, 24.00 >
< 0198613202, The Concise Oxford Dictionary of Current English, 29.95 >
< 0385312547, The American Heritage Dictionary, 12.95 >
< 0003750299, Collins Cobuild English Dictionary, 55.00 >
< 0395448956, The American Heritage Dictionary of the English Language, 50.00 >
< 0198612710, The New Shorter Oxford English Dictionary (2 Vol.), 135.00 >
< 0198612583, The Compact Oxford English Dictionary, 375.00 >
< 0198612605, Oxford English Dictionary: CD-Rom for Windows (20 Vol./1 CD), 395.
00 >
< 0789428741, Ultimate Visual Dictionary, 16.95 >
< 0028616731, Webster's New World College Dictionary, 23.95 >
< 0440218616, The American Heritage Dictionary (Paperback), 6.50 >
15 rows found.
表にデータを移入した後は、データベースと同様にデータ・ストアで処理を行うことができます。次のレッスンでは、様々なユーティリティを使用してデータ・ストアで処理を行います。ttBulkCpユーティリティの詳細は、『Oracle TimesTen In-Memory Database APIリファレンス・ガイド』を参照してください。